#ifndef FTIPS_FINGERTIP_H_
#define FTIPS_FINGERTIP_H_

#include "IFingerTipsDetector.h"
#include <list>
#include "cv.h"

struct CvMemStorage;
struct CvSeq;
struct CvPoint;

namespace ftips {
	class PointsClassifier;

	// Class: use DetectFingerTips method to detect finger tips
	class FingerTipsDetector: public IFingerTipsDetector {

		// private constant
	private:
		static const int MINK = 35;
		static const int MAXK = 45;
		static const int COS_THEESHOLD = -6;

		// private methods
	private:
		bool CalTipPointsCenter(std::list<CvPoint> *pPointsList, CvPoint *pCenter);

		void GetGroovePointsList(CvSeq *pContour, PointsClassifier *pClassifier, std::list<CvPoint> *pointsPosList);
		void GetTipPointsList(CvSeq *pContour, PointsClassifier *pClassifier, std::list<CvPoint> *pTipsList);
		void GetPointsListFromIndex(CvSeq *pContour, PointsClassifier *pClassifier,
			std::list<int> *pointsIndexList, std::list<CvPoint> *pointsPosList);

		// public methods
	public:
		bool DetectFingerTips(CvSeq *pContour, std::list<CvPoint> *pTipsList, std::list<CvPoint> *pGroovesList);
		virtual ~FingerTipsDetector();
	};

}

#endif